home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Baxterdatt2110784252008.psc / Baxterdattleweezle Virus / clsOnTop.cls < prev    next >
Text File  |  2000-10-19  |  1KB  |  35 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsOnTop"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. 'ontop api
  15. Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  16.  
  17. 'api constants
  18. Const HWND_TOPMOST = -1
  19. Const HWND_NOTOPMOST = -2
  20. Const SWP_NOMOVE = &H2
  21. Const SWP_NOSIZE = &H1
  22. Const SWP_NOACTIVATE = &H10
  23. Const SWP_SHOWWINDOW = &H40
  24. Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  25.  
  26. 'make a form normal
  27. Public Sub MakeNormal(hWnd As Long)
  28.     SetWindowPos hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
  29. End Sub
  30.  
  31. 'make a form topmost
  32. Public Sub MakeTopMost(hWnd As Long)
  33.     SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
  34. End Sub
  35.